// area，地区相关
import { post } from '@/api/http'

// 简版
export default {
  // 省份
  area_province: {
    label: 'name',
    keyword: 'name',
    key: 'code',
    mode: 'each',
    data: {
      level: 1,
    },
    api: (data: any) => post({ url: '/area/findByNameAndParent', data }),
  },
  // 城市
  area_city: {
    label: 'name',
    keyword: 'name',
    key: 'code',
    mode: 'once',
    api: (data: any) => post({ url: '/area/findCitysByName', data }),
  },
  area_city_each: {
    label: 'name',
    keyword: 'name',
    key: 'code',
    mode: 'each',
    data: {
      level: 2,
    },
    api: (data: any) => post({ url: '/area/findByNameAndParent', data }),
  },
  //区域
  area_area: {
    label: 'name',
    keyword: 'name',
    search: true, // 支持搜索
    key: 'code',
    mode: 'each',
    api: (data: any) => post({ url: '/area/findByNameAndParent', data }),
  },
}
